home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
100 Free Apps - The Best Freeware for the Mac!
/
100 Free Apps The best freeware for the Mac!.iso
/
Data
/
mwcd_lib.js
< prev
next >
Wrap
Text File
|
2003-10-07
|
3KB
|
95 lines
// detect browser
var browser = new Object();
browser.version = parseInt(navigator.appVersion);
browser.isNetscape = false; browser.isIE = false;
if (navigator.appName.indexOf('Netscape') != -1) {
browser.isNetscape = true;
}
else if (navigator.appName.indexOf('Microsoft') != -1) {
browser.isIE = true;
}
// resize detect
if(!window.saveInnerWidth) {
window.onresize = resizeMe;
window.saveInnerWidth = window.innerWidth;
window.saveInnerHeight = window.innerHeight;
}
// end resize detect
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}
var preloadFlag = false;
function preloadImages() {
// alert("preloading basic");
if (document.images) {
butweb_over = newImage('images/b/b_viewwebsite_over.gif');
butweb_down = newImage('images/b/b_viewwebsite_down.gif');
butinstalldemo_over = newImage('images/b/b_installdemo_over.gif');
butinstalldemo_down = newImage('images/b/b_installdemo_down.gif');
butsearch_over = newImage('images/b/b_search_over.gif');
butsearch_down = newImage('images/b/b_search_down.gif');
butprevious_over = newImage('images/b/b_previous_over.gif');
butprevious_down = newImage('images/b/b_previous_down.gif');
butnext_over = newImage('images/b/b_next_over.gif');
butnext_down = newImage('images/b/b_next_down.gif');
butinstall_over = newImage('images/b/b_install_over.gif');
butinstall_down = newImage('images/b/b_install_down.gif');
butviewpdf_over = newImage('images/b/b_viewpdf_over.gif');
butviewpdf_down = newImage('images/b/b_viewpdf_down.gif');
butviewdetails_over = newImage('images/b/b_viewdetails_over.gif');
butviewdetails_down = newImage('images/b/b_viewdetails_down.gif');
butcontinue_over = newImage('images/b/b_continue_over.gif');
butcontinue_down = newImage('images/b/b_continue_down.gif');
vtinstall_over = newImage('images/updates/updates_p2_title.gif');
preloadFlag = true;
}
}
function resizeMe() {
if (saveInnerWidth < window.innerWidth || saveInnerWidth > window.innerWidth ||
saveInnerHeight > window.innerHeight || saveInnerHeight < window.innerHeight )
{
window.history.go(0);
}
}
function isNetscape() {
if (browser.isNetscape) {
return true;
} else {
return false;
}
}
function moveFiletoDisk(thefile, thefilename) {
var win = window.open("", "win", "width=300,height=250"); // a window object
with (win.document) {
open("text/html", "replace");
write("<HTML><HEAD><TITLE>Install" + thefilename + "</TITLE><META HTTP-EQUIV='Refresh' CONTENT='2;URL=" + thefile + "'></HEAD><BODY><div align=center>");
write("<h1>" + thefilename + "</h1><br> <br>");
write("<br> <br> <br><font face='arial, helvetica, geneva' size=1 color='#333333'>Samples may take a few minutes to load <br>over slow internet connections.<br> <br>Requires QuickTime</font></div></body></html>");
close();
}
}